package com.neusoft.liduan.d0914;

public abstract class Shape {
	protected double w;
	protected double h;
	protected double r;
	
	public Shape(double w, double h, double r) {
		this.w = w;
		this.h = h;
		this.r = r;
	}
	
	public Shape(double r) {
		this(0, 0, r);
	}
	
	public Shape(double w, double h) {
		this(w, h, 0);
	}
	
	/**
	 * 面积
	 * @return
	 */
	public abstract double area();
	
	/**
	 * 周长
	 * @return
	 */
	public abstract double perimeter();

	public double getW() {
		return w;
	}

	public void setW(double w) {
		this.w = w;
	}

	public double getH() {
		return h;
	}

	public void setH(double h) {
		this.h = h;
	}

	public double getR() {
		return r;
	}

	public void setR(double r) {
		this.r = r;
	}

}
